<template>
  <header>
    <div class="l-content">
      <el-button @click="handleMenu" plain icon="el-icon-menu" size="medium"></el-button>
      <h3 style="color: #fff">首页</h3>
    </div>
    <div class="r-content">
      <el-dropdown trigger="click" size="mini" style="cursor: pointer">
        <span>
          <img class="user" :src="userImg" alt="为加载...">
        </span>
<!--        <strong class="userInfo">刘小龙</strong>-->
        <el-dropdown-menu slot="dropdown">
          <el-dropdown-item>个人中心</el-dropdown-item>
          <el-dropdown-item>退出</el-dropdown-item>
        </el-dropdown-menu>
      </el-dropdown>
    </div>
  </header>
</template>

<script>
export default {
  name: "CommonHeader",
  data(){
    return{
      userImg: require('@/assets/logo.png')
    }
  },
  methods: {
    handleMenu(){
      this.$store.commit("collapseMenu")
    }
  }
}
</script>

<style scoped lang="less">
header{
  display: flex;
  height: 100%;
  justify-content: space-between;
  align-items: center;
}
.l-content{
  display: flex;
  align-items: center;
  .el-button{
    margin-right: 20px;
  }
}
.r-content{
  .user{
    margin-right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
  }
}
</style>